﻿using System;

namespace InfoJetSoft.Service.Util
{
    /// <summary>
    /// Summary description for MessageUtil.
    /// </summary>
    class MessageUtil
    {

        public static string HttpErrorToSubmit(System.Net.HttpStatusCode statusCode)
        {
            if (ConfigUtil.IsCN())
            {
                return "提交表单时遇到错误，响应状态代码为：" + statusCode;
            }
            else
            {
                return "Error to submit the form, response Status Code is " + statusCode;
            }
        }

        public static string DavFormExisted(Uri uri)
        {
            if (ConfigUtil.IsCN())
            {
                return uri.ToString() + " 已经存在。";
            }
            else
            {
                return uri.ToString() + " has existed.";
            }
        }

        public static string NeedsKeyTempFolder()
        {
            if (ConfigUtil.IsCN())
            {
                return "键InfoJetSoft.Service.TempFolder未设置。";
            }
            else
            {
                return "Please set the key InfoJetSoft.Service.TempFolder first.";
            }
        }

        public static string NeedsMailToAddress()
        {
            if (ConfigUtil.IsCN())
            {
                return "邮件地址To、Cc、Bcc其中之一必须被设置。";
            }
            else
            {
                return "One of To, Cc, or Bcc e-mail address must be specified.";
            }
        }

        public static string NeedsMailFromAddress()
        {
            if (ConfigUtil.IsCN())
            {
                return "找不到邮件发送地址。";
            }
            else
            {
                return "Cannot find the From e-mail address.";
            }
        }

        public static string FormSubmitted()
        {
            if (ConfigUtil.IsCN())
            {
                return "表单提交成功。";
            }
            else
            {
                return "The form was submitted successfully.";
            }
        }

        public static string OnSubmitRequestFailed()
        {
            if (ConfigUtil.IsCN())
            {
                //InfoJet Service --> InfoBus Modified by Sunny 2013.04.07
                return "InfoBus未能提交表单。\nonSubmitRequest事件的返回值标识提交失败。";
            }
            else
            {
                //InfoJet Service --> InfoBus Modified by Sunny 2013.04.07
                return "InfoBus cannot submit the form.\nThe onSubmitRequest event handler returned a value indicating that the submit failed.";
            }
        }

        public static string Error2Load()
        {
            if (ConfigUtil.IsCN())
            {
                return "加载失败：";
            }
            else
            {
                return "Error to load ";
            }
        }

        public static string Error2Query()
        {
            if (ConfigUtil.IsCN())
            {
                return "查询失败：";
            }
            else
            {
                return "Error to query ";
            }
        }

        public static string Error2Refresh()
        {
            if (ConfigUtil.IsCN())
            {
                return "刷新失败：";
            }
            else
            {
                return "Error to refresh ";
            }
        }

        public static string Error2Submit()
        {
            if (ConfigUtil.IsCN())
            {
                return "提交失败：";
            }
            else
            {
                return "Error to sumbit ";
            }
        }

        public static string SelectFileMessage()
        {
            if (ConfigUtil.IsCN())
            {
                //CID 0459 //2011.04.11 //Begin
                return "单击此处以附加文件";
                //CID 0459 //2011.04.11 //End
            }
            else
            {
                //CID 0459 //2011.04.11 //Begin
                return "Click here to attach a file";
                //CID 0459 //2011.04.11 //End
            }
        }

        public static string CannotLoadSystemAssembly()
        {
            if (ConfigUtil.IsCN())
            {
                return "未能加载System程序集。";
            }
            else
            {
                return "Cannot load System Assembly.";
            }
        }

        public static string DotNet2Required()
        {
            if (ConfigUtil.IsCN())
            {
                return "需要 .NET Framework version 2.0。";
            }
            else
            {
                return ".NET Framework version 2.0 Required.";
            }
        }

        public static string PrintableVersion()
        {
            if (ConfigUtil.IsCN())
            {
                return "可打印版本";
            }
            else
            {
                return "Printable Version";
            }
        }

        //CID 0008 //2008.06.12 //Begin
        public static string CannotInsertSectionOrRowMessage()
        {
            string cannotInsertSectionOrRowMessage = ConfigUtil.CannotInsertSectionOrRowMessage();
            if (cannotInsertSectionOrRowMessage != null)
            {
                return cannotInsertSectionOrRowMessage;
            }
            else
            {
                if (ConfigUtil.IsCN())
                {
                    return "不能插入节或行：\n因为该片段没有有效的插入点，所以试图进行的片断操作无法完成。";
                }
                else
                {
                    return "Cannot insert the section or row because:\nThe attempted fragment operation cannot be completed because there is no valid insertion point for the fragment.";
                }
            }
        }
        //CID 0008 //2008.06.12 //End

        //CID 0859 //2012.03.15 //Begin
        public static string FormCannotBeSubmittedForValidationErrors()
        {
            if (ConfigUtil.IsCN())
            {
                return "表单含有验证错误，不能被提交。";
            }
            else
            {
                return "The form cannot be submitted because it contains validation errors.";
            }
        }
        //CID 0859 //2012.03.15 //End

        //CID 0859 //2012.03.20 //Begin
        public static string FormContainsValidationErrors()
        {
            if (ConfigUtil.IsCN())
            {
                return "表单含有验证错误。";
            }
            else
            {
                return "The form contains validation errors.";
            }
        }
        //CID 0859 //2012.03.20 //End
    }
}
